import {Entity, Column, PrimaryGeneratedColumn,DeleteDateColumn} from 'typeorm';

@Entity('account')
export class AccountEntity {
    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'id',
    })
    id: number;

    get createdAt(): Date {
        return this._createdAt
    }

    set createdAt(value: Date) {
        this._createdAt = value
    }

    @Column({
        type: 'varchar',
        length: 50,
        name: 'username',
        comment: '用户名',
    })
    username: string;

    @Column({
        type: 'varchar',
        length: 100,
        name: 'password',
        comment: '密码',
    })
    password: string;
    @Column({
        type: 'timestamp',
        name: 'created_at',
        comment: '创建时间',
    }) private _createdAt: Date;
    @Column({
        type: 'timestamp',
        name: 'updated_at',
        comment: '更新时间',
    })
    updatedAt: Date;
    @DeleteDateColumn({
        type: 'timestamp',
        name: 'deleted_at',
        comment: '软删除时间',
        nullable:false
    })
    deletedAt: Date;
}
